<?php 
if(!isset($_SESSION)) 
{ 
session_start(); 
} 

if (isset($_SESSION['s_cameras']) and is_array($_SESSION['s_cameras']) and isset($_REQUEST['pageNum']) and isset($_REQUEST['rows_per_page'])) {
	
	$mylist = $_SESSION['s_cameras'];
	
	$pageNum = $_REQUEST['pageNum'];
	$rows_per_page = $_REQUEST['rows_per_page'];
	$pageend = $pageNum*$rows_per_page;
	$pagestart = $pageend - $rows_per_page;
	$index = 0;
	$real = 0;
	foreach ($mylist as $key =>$row){
			//array($row[id],$row[name],$counts,$isReg,$isNoReg,$percents,$m_fromdate,$m_todate,$monitorid);
			$index+=1;
			if ($index<=$pagestart) {
				continue;
			}elseif ($index > $pageend){
				break;
			}
			else{$real++;		 
			 ?>
			 <tr>
			 	<td width="6%"><?=$index?></td>
			 	<td width="6%"><?=$row[0]?></td>
			 	<td width="21%"><?=$row[1]?></td>
			 	<td width="11%"><?=$row[2]?></td>
			 	<td width="11%"><?=$row[3]?></td>
			 	<td width="11%"><?=$row[4]?></td>
			 	<td width="11%" <?php if($row[5] == 100){?>style="color:#00FFB6"<?php }elseif($row[5] < 50 ){?>style="color:#FF3A3A"<?php }?> ><?=$row[5]?>%</td>
			 	<td width="11%"  class="last" align="center"><a style="color: #0000FF;cursor: pointer" onclick="OpenView(this,'<?=$row[8]?>','<?=base64_encode($row[0])?>','<?=base64_encode($row[7])?>','<?=base64_encode($row[6])?>')">보기</a></td>
			 </tr>  
			 <?php 
			}
				
	}  
	if ($real>0 and $real<$winH/28) {
	 	foreach(range(0,$winH/28-$real) as $i){
	 		?>
	 		<tr>
		 	<td width="6%">&nbsp;</td>
		 	<td width="6%">&nbsp;</td>
		 	<td width="21%">&nbsp;</td>
		 	<td width="11%">&nbsp;</td>
		 	<td width="11%">&nbsp;</td>
		 	<td width="11%">&nbsp;</td>
		 	<td width="11%">&nbsp;</td>
		 	<td width="11%"  class="last">&nbsp;</td>
		 	</tr>
	 	<?php }
	}
	
	  
}
?>

